<%--
  Created by IntelliJ IDEA.
  User: 123
  Date: 2024/6/27
  Time: 19:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@page import="qin.com.DataConnection" %>

<%@ page import="java.util.List" %>

<%@ page import="qin.com.Users" %>
<%@ page import="qin.com.ChengJi" %>

<html>

<head>

    <title>Title</title>

</head>

<body>

<%

    //创建查询命令

    String sql="select id,name,java,jsp,oracle from chengji";

    //通过数据库类的query()方法获取数据表users的所有数据

    List<ChengJi> list=new DataConnection<ChengJi>().query(ChengJi.class,sql,null);

%>

<table width="100%" border="1">

    <tr align="center">

        <td align="center">编号</td>

        <td>姓名</td>

        <td>java</td>

        <td>jsp</td>

        <td>oracle</td>
        <td>操作</td>

    </tr>

    <%

        //遍历所有数据

        for(int i=0;i<list.size();i++){

    %>

    <tr align="center">

        <td><%=list.get(i).getId()%></td>

        <td><%=list.get(i).getName()%></td>

        <td><%=list.get(i).getJava()%></td>

        <td><%=list.get(i).getJsp()%></td>

        <td><%=list.get(i).getOracle()%></td>

        <td>

            <a href="insertusers.jsp">添加用户</a>

            <a href="updateusers.jsp?id=<%=list.get(i).getId()%>">更新用户</a>

            <a href="newdusers.jsp?id=<%=list.get(i).getId()%>">删除用户</a>

        </td>

    </tr>

    <%

        }

    %>

</table>

</body>

</html>